<template>
	<view class="fixedbody">
		<view class="successBox">
			<view class="doneIcon"><uni-icons type="checkbox-filled" size="100" color="#1EC886"></uni-icons></view>

			<!-- <view v-if="chargeFlag == '0'" style="margin: 0 0 80rpx;">报名成功</view> -->
			<view style="margin: 0 0 80rpx;">
				<view>支付成功</view>
				<view class="ppp">
					订单金额
					<text class="orange">￥{{ amount }}</text>
				</view>
				<view class="ppp">
					交易方式
					<text v-if="payType == '2'">会员卡支付</text>
					<text v-else-if="payType == '0'">微信支付</text>
					<text v-else-if="payType == '1'">线下支付</text>
				</view>
			</view>
			<button class="btn btn1" style="margin: auto;" @click="goDetail">查看订单</button>
		</view>
	</view>
</template>

<script setup>
import { reactive, toRefs } from 'vue';
import * as match from '@/common/match.js';
import { onLoad } from '@dcloudio/uni-app';
const data = reactive({
	chargeFlag: '',
	amount: '',
	payType: ''
});
const { chargeFlag, payType, amount } = toRefs(data);
const app = getApp();
let cptId;
let groupId;
let orderId;
onLoad(option => {
	if (option) {
		payType.value = option.payType;
		amount.value = option.payTotal;
		console.log(option);
	}
});
function goDetail() {
	// 前往订单详情
	uni.redirectTo({
		url: `/pages/usercenter/myTrain/index/index?current=${1}`
	});
}
</script>

<style lang="scss" scoped>
.successBox {
	text-align: center;
}
.doneIcon {
	margin: 5vh auto;
}
.ppp {
	text-align: left;
	font-size: 30rpx;
	padding: 0 30rpx;
	color: #a0a0a0;
	margin: 20rpx 0;
	text {
		float: right;
		color: #000;
	}
}
</style>
